<template>
  <van-swipe
    :show-indicators="showIndicators"
    :height="height"
    :loop="true"
    :touchable="true"
    class="my-swipe"
    :autoplay="autoplay"
    :stop-propagation="false"
  >
    <template :key="item.id" v-for="item in swiperItemList">
      <van-swipe-item>
        <a :href="item.link ? item.link : ''">
          <img v-lazy="item.pic" />
        </a>
      </van-swipe-item>
    </template>
  </van-swipe>
</template>

<script lang="js">
import {defineComponent, reactive, ref} from 'vue'

export default defineComponent({
  props: {
    swiperItemList:{
      type:Array,
      default(){
        return []
      }
    },
    height:{
      type:Number,
      default:300
    },
    showIndicators:{
      type:Boolean,
      default:false
    },
    autoplay:{
      type:Number,
      default:3000
    }
  },
  components: {

  },
  setup() {

    const change=(e)=>{
        e.stopPropagation();
    }
    return {
      change
    }

  }
})
</script>

<style scoped lang="less">
.my-swipe {
  img {
    width: 100%;
    height: 100%;
  }
}
</style>
